<?php
require '../config.php';
require '../libs/class.login.php';

$log = new logmein();
$log->checklogin();

$mod = isset($_POST['mod']) ? strval($_POST['mod']) : NULL;
$id = isset($_POST['id']) ? intval($_POST['id']) : 0;
$value = isset($_POST['value']) ? intval($_POST['value']) : 0;

switch ($mod){
	case 'category':
		if ($value == 1)
			echo true;
		else
			echo false;

		$query = 'UPDATE categories SET c_active = ' . $value . ' WHERE c_id = ' . $id;
		$db->Query($query);
	break;
	case 'games':
		if ($value == 1)
			echo true;
		else
			echo false;

		$query = 'UPDATE games SET active = ' . $value . ' WHERE g_id = ' . $id;
		$db->Query($query);
	break;
}